
config_mini_file=build/script/opengauss_config_file_mini
config_sample_file=/data/code/openGauss-server-2.1.0/dest/share/postgresql/postgresql.conf.sample
if [[ -f $config_mini_file ]]
then
    if [[ ! -f "$config_sample_file" ]]
    then
        echo "postgresql.conf.sample does not exist"
    else
        echo "set opengauss lite config parameters"
        while IFS= read -r line; do
            SUBSTRING=$(echo $line | cut -d'=' -f 1)"= "
            if grep -q "$SUBSTRING" $config_sample_file ; then
                sed -i "/$SUBSTRING/c$line" $config_sample_file
            else
                echo $line >> $config_sample_file
            fi
        done < $config_mini_file
    fi
fi